from django.db import models

# Create your models here.
# 用户表
class User(models.Model):
    username =models.CharField(max_length=200)
    password =models.CharField(max_length=200)
    class Meta:
        db_table = 'user'
# 产品表
class Goods(models.Model):
    name =models.CharField(max_length=200)
    price =models.CharField(max_length=200)
    num =models.IntegerField()
    img = models.CharField(max_length=200)
    class Meta:
        db_table = 'goods'
# 评论表
class Comment(models.Model):
    gid = models.IntegerField()
    uid = models.IntegerField()
    content  = models.CharField(max_length=200)
    class Meta:
        db_table = 'comment'


# 订单表
class Ding(models.Model):
    uid = models.IntegerField()
    gid = models.IntegerField()
    price = models.CharField(max_length=200)
    time = models.CharField(max_length=200)
    # 订单号
    number = models.CharField(max_length=200)
    is_comment = models.IntegerField(default=0)
    class Meta:
        db_table = 'ding'

# 订单详情表 有多少商品
class Ding_Info(models.Model):
    did = models.IntegerField()
    goods= models.CharField(max_length=200)
    class Meta:
        db_table = 'ding_info'